﻿<!--#include file="utf-8.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="seeion.asp"-->
<!--#include file="page.asp"-->
<!--#include file="sqlerr.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="images/style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td height="30" class="head"><strong>公司简介管理</strong></td>
</tr>
<tr>
<td height="400" valign="top">

    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"  class="head_chile">
    <tr>
    <td width="30%">·中文名称</td>
    <td width="30%">英文名称</td>
    <td width="8%" align="center">排序</td>
    <td width="8%" align="center">修改排序</td>
    <td width="8%" align="center">修改内容</td>
    <td width="8%" align="center">修改新闻</td>
    </tr>
    </table>

<%	
set rs=server.createobject("adodb.recordset") 
exec="select * from about order by px_id asc" 
rs.open exec,conn,1,1 
if rs.eof then
response.Write "&nbsp;暂无内容！"
else
rs.PageSize =10 '每页记录条数
iCount=rs.RecordCount '记录总数
iPageSize=rs.PageSize
maxpage=rs.PageCount 
page=request("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif  page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if	
%>
<%For i=1 To x%>
<form  name="add" method="post" action="Manage_about.asp?type=update">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td width="53%" height="0">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td width="30%" height="25" ><input name="id" type="hidden" id="id" value="<%=rs("id")%>" /><%=rs("title")%></td>
    <td width="30%" height="25" ><input name="id2" type="hidden" id="id2" value="<%=rs("id")%>" /><%=rs("etitle")%></td>
    <td width="8%" height="25" align="center" ><input class="textbox" name="px_id" type="text" value="<%=rs("px_id")%>" size="2"></td>
    <td width="8%" height="25" align="center" ><input class="button" type="submit" name="button" id="button" value="修改顺序"></td>
    <td width="8%" height="25" align="center" ><input class="button" type="button" name="Submit3" value="修改" onClick="window.location.href='admin_about.asp?type=update&id=<%=rs("id")%>'"/></td>
    <td width="8%" height="25" align="center" ><input class="button" type="button" name="Submit" value="删除" onClick="javascript:if(confirm('确定删除？删除后不可恢复!')){window.location.href='Manage_about.asp?type=del&id=<%=rs("id")%>';}else{history.go(0);}" /></td>
    </tr>
    </table>
</td>
</tr>
</table>
</form>
<%rs.movenext
next
%>
<%
end if
%>
</td>
</tr>
<tr>
<td>
<%'以下显示分页
call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
rs.close
set rs=nothing
%></td>
</tr>
</table>
</body>
</html>

<% 
if Request.QueryString("type")="update" then
	id=request("id") 
	sql="select * from about where id="&id 
	set rs=server.CreateObject("adodb.recordset")
	rs.open sql,conn,1,3
	IF not isNumeric(request("px_id")) then
		response.write("<script>alert(""排序ID必须为数字！""); history.go(-1);</script>")
		response.end
	end if
	rs("px_id")=request.form("px_id") 
	rs.update 
	rs.close 
	response.Write("<script language=""javascript"">window.location.href='Manage_about.asp';</script>")
	'alert(""修改排序成功！"");
end if
%> 

<%
if request("type")="del" then
	id=request("id")
	if id="" then
		Response.Write "<script language='javascript'>alert('参数错误!');document.location.href('Manage_about.asp');</script>"
		Response.End()
	end if
	sql="select * from about where id="&id 
	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,3
	if rs.bof and rs.eof then
		Response.Write "<script language='javascript'>alert('数据库中没有该记录！');document.location.href('Manage_about.asp');</script>"
		Response.End()
	else
		rs.Delete
		rs.Update
		Response.Write "<script language='javascript'>alert('成功删除指定的信息！');document.location.href('Manage_about.asp');</script>"
	end if
end if
%>